/**
 * Created by Dalyn on 2017/3/24.
 */
import Relay from "react-relay";

export default class PayOrderMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { payOrder }`;
    }

    getVariables() { 
        return {
            argsInput: {
                orderId: this.props.orderId,
                payment: this.props.payment,
                // orderMoney: this.props.orderMoney,
                payWayOrder: this.props.payWayOrder,
                payWayLoan: this.props.payWayLoan,
                payWayAccount: this.props.payWayAccount
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on payOrderPayload {
            data {
                errorCode
                value
                totalResult
                id
                orderPaymentRecord{
                            partyAEnid
                            partyAEnName
                            partyBEnid
                            partyBEnName
                            masterOrderId
                            orderId
                            source
                            payment
                }

            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on payOrderPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        orderPaymentRecord{
                            partyAEnid
                            partyAEnName
                            partyBEnid
                            partyBEnName
                            masterOrderId
                            orderId
                            source
                            payment
                        }
                    }
                }
            `]
        }];
    }

}
